package com.spzx.channel.service.impl;

import com.spzx.channel.service.IBrandService;
import com.spzx.common.core.constant.SecurityConstants;
import com.spzx.common.core.domain.R;
import com.spzx.product.api.RemoteBrandService;
import com.spzx.product.api.RemoteCategoryService;
import com.spzx.product.api.domain.vo.BrandVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * ClassName: BrandServiceImpl
 * Package: com.spzx.channel.service.impl
 * Description:
 */
@Service
@Slf4j
public class BrandServiceImpl implements IBrandService {
    @Autowired
    private RemoteBrandService remoteBrandService;
    @Override
    public List<BrandVo> getAllBrand() {
        R<List<BrandVo>> allBrandListResult = remoteBrandService.getAllBrandList(SecurityConstants.INNER);
        if (R.FAIL == allBrandListResult.getCode()) {
            log.error("调用商品服务失败:{}" , allBrandListResult.getMsg());
        }
        return allBrandListResult.getData();
    }
}
